package views.projet.onglet;

import java.awt.Color;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.border.TitledBorder;

import main.NotInitializedException;
import models.projet.Projet;
import controllers.OngletProjetsController;

public class AffectationProjet extends AbstractProjetView {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private EmployesDispoView lesEmployes;

	public AffectationProjet(OngletProjetsController controller, Projet leProjet) throws NotInitializedException {
		super(controller, leProjet);
		this.setBackground(new Color(240, 240, 240));
		this.setBorder(new TitledBorder(null, "Personnes affect\u00E9es", TitledBorder.LEADING, TitledBorder.TOP, null, null));	
		
		this.lesEmployes = new EmployesDispoView(controller);
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addComponent(lesEmployes, GroupLayout.DEFAULT_SIZE, 438, GroupLayout.DEFAULT_SIZE)
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addComponent(lesEmployes, GroupLayout.DEFAULT_SIZE, 274, GroupLayout.DEFAULT_SIZE)
		);
		setLayout(groupLayout);
	}
	
	public void refresh() throws NotInitializedException
	{
		this.lesEmployes.refresh();
	}
}
